<template>
	<view>
		<view v-if="isNotFound" class="notfound">
			<view class="top">
				还没有购买任何宝贝
			</view>
			<view class="bottom">
				快去逛一下吧！
			</view>
		</view>
		<purchasemode :BookList="BookList"></purchasemode>
	</view>
</template>

<script>
	export default {
		data() {
			return { 
				BookList:[],
				isNotFound: false
			}
		},
		onLoad(){
			this.getPurMes();
		},
		methods: {
			async getPurMes(){
				let header = new Object
				let vm = this
				header.Authority = getApp().globalData.Authority
				let res = await getApp().UniRequest('/twohandbook/buyBookRecord/authority/myBuy','GET','',header)
				console.log(res)
				if (res.code == 20000){
					
					if (res.data.data.length == 0){
						vm.isNotFound = true
					}
					res.data.data.forEach(Element=>{
						Element.buyList.forEach(Elemenn=>{
							this.BookList.push(Elemenn)
						})
					})
				}else {
					vm.isNotFound = true
				}
			} 
		}
	}
</script>

<style lang="scss">
	.notfound{
		position: relative;
		top: 300rpx;
		.top{
			text-align: center;
			font-size: 34rpx;
		}
		.bottom{
			text-align: center;
			color: #999999;
		}
		
	}
</style>
